cancel
Showing results for 
Search instead for 
Did you mean: 

Upsert in SAP Build Apps

Vinay_kosaraju
Explorer
0 Kudos

Dear All,

We have a requirement to use the Upsert functionality in the SAP build Apps to update\create records in SuccessFactors. Unfortunately we don't see the option under the Logic Canvas for the Data. Could you please suggest if this feature is supported or not.

Accepted Solutions (1)

Accepted Solutions (1)

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos

Why can't you update the record with the Nov date -- because the backend won't accept it (because the start date is a key to the record) or because you are not able to pass it with SAP Build Apps?

Also, if the date were unchanged, you'd be able to update it the record, right?

So why can't you just compare the dates and if they are the same update, if different create new record?

Answers (4)

Answers (4)

Chandrashekhar
Explorer
0 Kudos

Hello Daniel

Greetings !

Thank you so much for providing the much-needed assistance, with your guidance we could able to complete our use case successfully.

I appreciate the kind of help and support to complete the build apps use case.

Thank you once again!

Best Regards

Chandra

Chandrashekhar
Explorer
0 Kudos

Dear Venkat

Right now we are working on the Crete record , will post an update shortly.

Best Regards

Chandra

Vinay_kosaraju
Explorer
0 Kudos

Dear Venkat

Thank you so much for your quick response , really appreciate it !

Let me give our use case scenario , we have a requirement to delimit( not to delete but to make department inactive ) for this we are using FODepartment API

First we are fetching the department details using the Get record collection and storing the details in Page Variable and build the UI.

Example Data from the Get Record Collection :

Department Code : 123456

Start Date : 10-JAN-2022

In the UI the user is selecting the status from Active to Inactive and the StartDate when the department should be made Inactive , so now we have 2 parameters Status and Start Date to be passed to UpdateRecord.

Example : Department Code : 123456

Start Date : 22-NOV-2023

Status : Inactive

Next we used updaterecord Data Logic Canvas, the input fields required are department code and StartDate which are mandatory , now the issue we are facing that startdate should be passed from the Get Record Collection not the user selected one which means the Input will be Department Code : 123456 , Start Date : 10-JAN-2022 and Status : Inactive , this works without any issue but we need the Start Date should be 22-NOV-2023 as the department will be getting inactive on this date.

Now since we cannot update the record with the start date 22-NOV-2023 , so we are looking to insert a new record with Department Code : 123456 , Start Date : 22-NOV-2023 and Status : Inactive hence asked if UPSERT can be used as this is available in the SuccessFactors but not in the Build Apps.

Sorry for the putting so much details but this is where we are not able to proceed further.

Best Regards

Chandra

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos

Why can't you update the record with the Nov date -- because the backend won't accept it (because the start date is a key to the record) or because you are not able to pass it with SAP Build Apps?

Also, if the date were unchanged, you'd be able to update it the record, right?

So why can't you just compare the dates and if they are the same update, if different create new record?

Venkat_Vyza
Active Participant
0 Kudos

Hi Chandra,

My understanding is, if you want to update the status of the Department 123456 to Inactive from 22-Nov-2023, you should pass on the End Date (NOT the Start Date) as shown below:

Department Code: 123456

End Date: 22-Nov-2023

Status: Inactive.

and I see that this API does have the end date (print screen below).

Please let me know your thoughts.

Thanks,

Venkat Vyza

Chandrashekhar
Explorer
0 Kudos

Dear Venkat

Good day to you !

We also have the similar understanding but if you see the Update Record for FODepartment the externalCode and StartDate is mandatory. I hope this clears what is the issue we are having, however we are now working on the create record logic. I will post you the update shortly.

Best Regards

Chandra

Vinay_kosaraju
Explorer
0 Kudos

Dear Venkat

We finally manage to solve this with creating the new record , during this process we understood that update record is not the correct option as the external code and start date is mandatory field and we don't have the option to make any changes so we have to create a new record with one more time slice ( this is how the SF works which we got to know after discussing with the functional team).

My sincere thanks to you for all your help and to Daniel W for his blogs which we have referred to complete our use case successfully.

Best Regards

Chandra

Venkat_Vyza
Active Participant
0 Kudos

Hi @tarunchavali,

I think we can achieve Upsert functionality with the available logic flow functions - Update Record and Create Record.

For the same trigger, you can make both - Update and Create calls.

First you make Update Call. Depending on the Response you get for the Update call, you can decide whether to trigger Create call or not.

Please let me know if it's not clear.

Thank you,

Venkat Vyza