I am facing an issue with Add Data Row.
In my scenario I have to check for the field, weather its present or not then have to take action accordingly, so on the 1st IF statement its working fine but in next IF’s instead to writing the data to same row it is generating/writing the data in a new row.
below is the screenshot of the output, its duplicating the data, whereas I am looking for data to be in 1 row than in multiple.
screenshot of the code from UiPath, here you can see the IF statement I have written and used Add Data Row
At last use Clear Data table activity and Pass the Dt name
@Gokul001 , where are you suggesting using the Clear DT? after all the IF statements? or after the last IF statement?
I did, and it’s clearing all the data from the DT and result is blank
Can you explain the flow? You have done it wrongly i think so. @indrajit.shah
In both the If condition you have used Add Data Row activity that why you have duplicated data in the excel file?
So, my input is a JSON, and by using Build DT, I have created headers for my data-table, and after desterilizing, I am looping in for each, in that I have assigned some variables, to get the values but some of the tags are missing in json, for that I have used If condition’s to check, if that tags are present or not, if not then put some predefined value to that field and populate the data along with that and if present then get the value from the json only and populate rest of the row data, like that I have put multiple IF condition’s.
Hope I am able to explain myself.
Remove all the add data row activity and use only one add data row activity at the last of if condition
thank you very much, that will work, I understand root cause of it.
btw, can you help me with one more thing, the input json field for effectiveDate have values of like this
but in my output its coming like this, whereas in build DT the column data type is selected as string.
Can you create new topic for this queries @indrajit.shah. It will confuse other user too who are look for the same issue
Kindly mark it as solved
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.