How to add values in each row


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

Parents
  • 0
    Certified Lead Developer

    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



  • 0
    Certified Lead Developer
    in reply to ZAINAB

    Can you try to remove the user input task and add it can. Redo the configurations and see if it works! Till this stage the configurations looks right so it is weird for the rule input to not pass the data into pv. So give it a try

  • I did tried it but it is not working . I have given the values in the edit processmodel to see if it works and it worked . 

    That means values are not getting passed from interface to PV. can you please suggest

  • 0
    Certified Lead Developer
    in reply to ZAINAB

    hi Zainab! 
    in the earlier code you shared I see you have done submit:true() for the Submit button. It means when this form submits the process will continue after the UI node. 

    then in saveinto you are doing start-process as well. Its not a good design.
    can you share the current code for Submit button widget. Also summarise the functioning of your main process as well as this start process. What are you trying to do here

  •  buttons: a!buttonLayout(
          primaryButtons: {
            a!buttonWidget_23r3(
              label: "Submit",
              style: "PRIMARY",
              submit: true,
              validate: true(),
              saveInto: {
                a!save(ri!FormattedEmails,local!formattedEmailString),
                a!save(ri!GASR_Requests.emailAddresses,local!rawEmails),
                a!startProcess(
                  processmodel:cons!GASR_WRITE_REQUESTS,
                  processParameters: {
                    Emails:local!formattedEmailString,
                  },
    
                ),
                a!save(
                  ri!GASR_Requests.requestorName,
                  rule!GBL_displayUserFirstLast(loggedInUser())
                ),
                a!save(
                  ri!GASR_Requests.requestorEmail,
                  loggedInUser()
                ),
                a!save(ri!GASR_Requests.createdOn, now()),
                a!save(
                  ri!GASR_Requests.requestStatus,
                  cons!GASR_AUDIT_STATUS_TYPES[1]
                ),
                a!save(
                  ri!GASR_Requests.requestType,
                  cons!GASR_REQUEST_TYPE
                ),
                a!save(ri!GASR_Requests.isActive, true()),
                /*a!save(ri!GASR_Requests.employeeIDs,index(ri!Result.body,"values",null()))*/
    
              },
              loadingIndicator: true()
            )
          },
          secondaryButtons: {
            a!buttonWidget_23r3(
              label: "Cancel",
              style: "NORMAL",
              submit: true,
              validate: false,
              value: true,
              saveInto: ri!cancel
            )
          }
        )  )
    )



    In the interface we will be entering emailaddress in per line format and then it will passed to the API . If we have any missing emailaddress from API response then displaying on UI

  • 0
    Certified Lead Developer
    in reply to ZAINAB

    You will have one process model which is calling this interface. So when you submit the form completes and that process model resumes. So one is your parent process. 
    Next you are starting the cons!GASR_WRITE_REQUESTS process model. This has a process parameter Emails to which you are assignign the local!formattedEmailString. 


    First question is what is this process model doing -cons!GASR_WRITE_REQUESTS? 

    Next, assuming the parent process has a pv!FormattedEmails - are other cdt fields getting updated properly in the parent process?

  • On the site on homescreen , I will happen a button called "New Request" (it will trigger the processmodel "writeRequest" ).when I click on that it will redirect to emailaddress form where we will entering emailaddresses to pass to the API . 




     

       a!columnLayout(
            contents: {
              a!cardLayout(
                contents: {
                  a!richTextDisplayField(
                    label: "",
                    labelPosition: "ABOVE",
                    value: {
                      a!richTextItem(
                        text: {
                          a!richTextIcon(icon: "plus"),
                          a!richTextItem(
                            text: { "New  Request" },
                            size: "SMALL",
                            style: { "EMPHASIS", "STRONG" }
                          )
                        },
                        color: "#efefef"
                      )
                    }
                  )
                },
                link: a!startProcessLink(processModel: cons!GASR_WRITE_REQUESTS),



    This code is to pass the value to the integration in PM

    submit: true,
    validate: true(),
    saveInto: {
    a!save(ri!FormattedEmails,local!formattedEmailString),
    a!save(ri!GASR_Requests.emailAddresses,local!rawEmails),
    a!startProcess(
    processmodel:cons!GASR_WRITE_REQUESTS,
    processParameters: {
    Emails:local!formattedEmailString,
    },

    ),

  • 0
    Certified Lead Developer
    in reply to ZAINAB
    a!startProcess(
    processmodel:cons!GASR_WRITE_REQUESTS,
    processParameters: {
    Emails:local!formattedEmailString,
    },

    If the  "New Request"  button will trigger the process model GASR_WRITE_REQUESTS you should remove this code block from your submit button's saveInto code. 

  • then how can i pass value to the integration ?

  • 0
    Certified Lead Developer
    in reply to ZAINAB

    submit is true for your button. when you click submit the process will get data from rule inputs and proceed ahead. you dont need additional start process smart service here. our current interface where you input email address and has that error field in a user input task in the same process right - GASR_WRITE_REQUESTS ? 

Reply Children