I'm currently passing emailaddresses in each line but when i submit it is storing values as test@test.com;test2@test.com but it has tostore in db as in new line and it has to be passed to an integration as {"test@test.com,test2@test.com"} Can someone please help
Discussion posts and replies are publicly visible
Give this a try and let me know if that works...For Database Storage (with newlines):Change line 219 --> a!save(ri!GASR_Requests.emailAddresses, local!data.emailAddresses),For integration:local!formattedEmailString: concat( "{""", joinarray(local!individualEmails, ","), """}" ),
It looks like the code you attached is working fine... What does the integration do? And why do you convert the list of emails from a string to an array, only to convert it back to a string again?
the integration needs to pass array of emails in {"test@test.com,test2@test.com"} otherwise it is throwing 400 error
integration is failing looks like it is not taking the values in correct format
Have you tried with passing hard coded value?
If it worked could you please share here that value.
in line 219 you assign an array to a text field, and Appian by default concatenates the array by placing a semicolon, that's why you get values as test@test.com;test2@test.com in the database. If you change the line 219 as Shubham suggested, it should work correctly for db changes. For integration part your code should work fine, i think, no changes needed.
Shubham Aware from interface?
Shubham Aware
What is the reason to to store the email address in new line is db? If db has data as 'test@test.com;test2@test.com' then you can format the data from db like below before sending to integration.
joinarray(split("test@test.com;test2@test.com", ";"),",")
I need to compare the entered emails vs integration API emails so that I need to display the missing mails from integration on the UI as invalid emails.Since in DB it is storing as the below formatted the integration is not returning the invalid emails properly . Please help in resolving the issue