ID Table bug

Leonardo_194044
Leonardo_194044 Posts: 3
edited September 2021 in Questions

Hello,

I was Developing a project where will be trigger by an email, in the e-mail I will get the file and the body, with the body I will get a data from an API and make a join with the file from the e-mail and the file from the API, after I will transform this excel to a Data table and create a new column called “Escalonamento” that I will apply formula to add Data to this column (will be 1,2 or 3). So I will create a table from unique values from column “Escalonamento” and loop for each table, inside this loop I will create another step to create tables for unique value (email/tagertManagerEmail) and loop trough this tables.

My problem is: In the first loop I use the system variable called “TABLE ID” to get the table that was created for each unique value and the second loop I need to use again this variable, but the system is understand that I’m calling the first Table ID, not the second after the second loop. Can you help me to fix that?

Any more doubts you can contact me or send an email, no problem.

Answers

  • Kalin_126161
    Kalin_126161 Posts: 73 admin
    edited September 2021

    Hi @Leonardo_194044 ,

    To clarify one detail you shared: the action Workflows: Start a workflow for each row is not technically a loop. It is a batch starter that will perform the same function for each row provided by the table/spreadsheet. This may help clear up the issue you're experiencing in your build.

    The current configuration in your workflow is expecting the action to increment (n+1) through the unique value table. Since this is not the case, referencing the field Table ID inside the batch action block will default to the first available value Catalytic finds - unless instructed to look somewhere else (via table lookup for example). As you've noted, this defaults to the table found in row 1 of your unique values table every time it is referenced.

    I have attached a workflow below that I think should solve for what you need here. To run this you will need to provide a spreadsheet file. I recommend using the file produced by the action Join both excel from your workflow as that is what I used for my testing.

    Once the workflow is run, you will notice that each instance created by the Batch: Start a workflow for each row step creates a different markdown table. This is because the batch action runs for each row in the provided table. Since each row of the table contains a different value for Table ID a different markdown table is created in each of the instances.

    Let me know if you have any questions and I will be happy to help.

    Thank you,
    Kalin

  • Hi, Thank you for the reply.

    I saw your Workflow and for the first step it's perfect, but inside this batch I need to get another unique value tables (by a different column) that is inside the Table that we get after the batch action and with this second Table ID I would have the final table to display as markdown. So the final Table ID is not getting the data for the second unique value, here it's the problem.

  • Kalin_126161
    Kalin_126161 Posts: 73 admin

    Hi @Leonardo_194044,

    Got it, in that case I think using the Tables: Look up data in a column should help get the data that you need. If you know the exact row of information you need all that you will need to do is configure the following -

    Let me know if this helps and if you have any other questions.

    Thank you,
    Kalin

  • Hi,

    Below I can show to you what I`m trying to do. I am creating a Table for unique value for Header Escalonamento (Action:Create tables for unique value) after get this table I am looping through it and inside the loop I am using the Table ID from the loop to create another unique value table for the Email Header (Action:Create tables for unique value) and get this Table to create another loop and scroll through this Table ID to turn to markdown and send the email.

    I tried to use this field (table-name--table-id) but I got an error --> The "Table ID" field value has an incorrect handlebar reference.

    So I cant use look up data because I dont know what e-mail will be. Maybe you can understand better what Im trying to say with images and help you think if what Im doing it`s right.





  • Kalin_126161
    Kalin_126161 Posts: 73 admin

    Hi @Leonardo_194044,

    I believe I may have found an approach for you but will need your confirmation. In my testing it looks like Table ID is overwritten in each run started in the batch step — so you can reuse this reference later on because of this. Attached is my workflow approach for this.

    In case it does not work, you could still try the lookup approach mentioned before. You may not know how many or what specific emails are going to be encountered, but the field Unique Value (that comes from the second unique table created) will contain the unique email that created a row in the table which can be used for the lookup.

    Let me know if you have any questions.

    Thank you,
    Kalin