Skip to main content
July 10, 2025
Question

How to add values in each row

  • July 10, 2025
  • 44 replies
  • 0 views


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

    44 replies

    shubhama926776
    July 10, 2025

    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, ","), """}" ),

    sabat0002Author
    July 10, 2025

    integration is failing looks like it is not taking the values in correct format

    shubhama926776
    July 10, 2025

    Have you tried with passing hard coded value?

    If it worked could you please share here that value.

    davidj137213
    July 10, 2025

    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?

    sabat0002Author
    July 10, 2025

    the integration needs to pass array of emails  in {"test@test.com,test2@test.com"}  otherwise it is throwing 400 error

    harshas2775
    July 14, 2025

    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", ";"),",")

    sabat0002Author
    July 14, 2025

    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



    harshas2775
    July 14, 2025

    In this code above, the contains() code logic will never be true given the local initial email address list is a text and not an array. Your code is comparing list of emails in simulated api feedback variable with the text

    "test@test.com, test2@test.com, testInvalid@test.com, test3@test.com" and it will always be false. Understand that your foreach will run just once because it has just one item. You need to convert the emails from db into an array then check.

     Try changing the code as below and let me know if its working - 

    a!foreach(
    trim(split(local!initialEmailAddressList,",")),
    if(contains(local!simulatedAPIFeedback.email,fv!item),
    {},
    fv!item)