web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Syntax for submitting ...
Power Apps
Answered

Syntax for submitting 2 forms to SP list

(0) ShareShare
ReportReport
Posted on by 415

Hello,

 

I have 2 SP lists, one with client info and the second has client workout data.  The second list pulls a client name from a lookup column.  When a new workout is created it pulls in the select client's name (Items property = Gallery2.selected) this is a View Form.  Then the trainer fills out the client workout Edit form.  I'm wanting to submit the client name and workout data to the second SP list.  The workout data submits no problem.  I'm not sure how to populate the selected client's name in this SP list.

 

Trish

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,989 Moderator on at

    @trishmalloy 

    Hi there.  It sounds like you want to see the Client's Name in your Workout Data List.  In Sharepoint, goto your Workout Data List, then list settings, and look at the setup options for your LookUp column.  You can bring in additional fields (i.e. Client Name) just as I have shown below.

     

    This is advantageous vs storing the Client Name in the Workout Data List because any changes to the Client's Name (e.g. Last Name change due to marriage) will show up automatically in the Workout Data List.

     

    imgxyz.png

     

    ---

    Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly.  If your thought the post was helpful please give it a "Thumbs Up."

  • v-siky-msft Profile Picture
    on at

    Hi @trishmalloy ,

     

    Is the client name  looked up from 'client info' list?

    Do you mean that the edit form only have workout data, but you also want to submit the client name which has been selected before editing form to SP list ?

     

    To patch a Sharepoint column, you should patch the record to it. In the record, it contains three required parameters ('@odata.type', ID and Value).

    • For the '@odata.type' field (Which I think is a predefined column), just copy and paste the following: '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
    • ID and Value is from the record what you look up

    So try to put the following formuals to Submit button:

    Patch('client workout data',Gallery2.Selected,{'client name':{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Id:<ID>, Value:<Value>}})

     

    Best regard,

    Sik

     

  • trishmalloy Profile Picture
    415 on at

    I must not be understanding what you're suggesting.  This is already set up on my 'Create Workout' list.  See attachment.  

     

    The Client Workout screen has 2 forms, I pulled in the name of the client by using Gallery2.selected and the other form has the fields for creating a workout.  I am looking for submit/patch syntax for saving the record.  Right now the workout data is being saved but not the client name.

  • trishmalloy Profile Picture
    415 on at

    I must be missing something, can you clarify?  See attachment.

  • mdevaney Profile Picture
    29,989 Moderator on at

    @trishmalloy 

    Okay.  I did not understand that you were looking for Patch formula syntax.  I will let @v-siky-msft work throught this with you because they will be more knowledgable on the subject.

  • v-siky-msft Profile Picture
    on at

    Hi @trishmalloy ,

     

    As you said, there are two forms on the screen, form1 shows the client name selected from gallery2, and form2 is to create a workout, right?

    What is the data source of gallery2, List of client?

    Do you want to patch the client name to the work out record created by form2, right?

     

    If my assumption is right, the formula needs to modify as below:

     

    Patch('client workout data',<BaseRecord>,{'client name':{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Id:<ID>, Value:<Value>}})

    Note:

     

    <BaseRecord> is the record submitted by form2, you need to use lookup function to find out that record you just created.

    You also need to modify <ID> and <Value> which are from the record you looked up. Since the client is selected from gallery2, they may be that <Id> is Gallery2.Selected.ID, <Value> is Gallery2.Selected.'Client Name'.

     

     

     

    Best regards,

    Sik

  • trishmalloy Profile Picture
    415 on at

    I'm sorry if I'm not explaining this correctly.  I first need to know how to create a record from 2 forms with the correct syntax.  

  • v-siky-msft Profile Picture
    on at

    Hi @trishmalloy ,

     

    To create a record from 2 forms, we have to firstly submit a record from Form2, and then patch the client name to that record(<BaseRecord>).

    So, just put following formulas to OnSelect of Button in the upper right corner.

    SubmitForm(Form2);
    Patch('client workout data',<BaseRecord>,{'client name':{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Id:<ID>, Value:<Value>}})

    Best regards,

    Sik

  • trishmalloy Profile Picture
    415 on at

    Hi @v-siky-msft ,

     

    I'm sorry to be a moron, I still need some help ... I'm not sure what to put in <BaseRecord>, I took a guess and put Gallery2.Selected. 

     

    SubmitForm(Form2);Patch('Create Workout - Set 1_3',Gallery2.Selected{"Title":{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Id:<ID>,Value:<Value>}})

     

    I'm getting the attached error message, "The specified column 'Client_x0020_Goals' does not exist'.  This field has nothing to do with this screen.  It is only used on the Client Profile screens.  I see this error when I mouse over the word "Selected"

  • trishmalloy Profile Picture
    415 on at

    @v-siky-msft  - Can you help with this?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard