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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Answered

Patch 2 Forms

(0) ShareShare
ReportReport
Posted on by 80

Hi,

I have a form with some fields (Form3) and in the top right corner I've created another "FormViewer" (FormViewer1) to display information like "Requestor" and the "Office Location".

Now with the save button I'd like to store the informations from both Forms in the same record.

First I wanted to try it like this:

Patch('listname', Defaults('listname'), Form3.Updates, FormViewer1.Updates)

But FormViewer does not have the option ".Updates". So I tried it like this:

Patch('listname', Defaults('listname'), Form3.Updates, {Requestor: DataCardValue26, Office: DataCardValue27})

This one stores the infos from Form3 but nothing else. How can I include the info

 

Categories:
I have the same question (0)
  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

     {Requestor: DataCardValue26, Office: DataCardValue27}

     

    You are mentioning control names. You need to mention properties too. Like DataCardValue26.Text or DataCardValue26.Value. Depends on whatever schema you have for your list

  • buzzen Profile Picture
    80 on at

    Many thanks for your quick reply... Thanks this worked for the Office location with "DataCardValue27.Text".

    But the Requestor field is in SP a "Person or Group" field. And here it always says:

    "The type of this argument 'Requestor' does not match the expected type 'Record'. Found type 'Text'"

    and also I've added this to the end ";NewForm(Form3)", but once saved it doesn't load a new form.

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    patching a person type field is complicated you need specific schema like this:

     

    {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",

    Claims:"i:0#.f|membership|" & User().Email,

    Department:"",

    DisplayName:User().FullName,

    Email:User().Email,

    JobTitle:"",

    Picture:""

    }

     

    change this User().Email to wherever you are getting your email id's from.

    This is a specific structure required to patch a person type column. Even though claims is the only thing which is important here. You still need to write all this.

  • buzzen Profile Picture
    80 on at

    Yeah looks really complicated... Don't know how to exactly implement that into my patch command....

     

    Do you also now why it doesn't load a NewForm?

  • Verified answer
    zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    There is also another way and better practice too. Take a text type column instead of person type column. In the combobox item property where you select person. Set office365user connector. Then in your patch code you can just save the display name that text column.

    a9.jpga10.jpg

     

     

    And if you want to use your current  patch code you can integrate it here

    {Requestor:

    {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",

    Claims:"i:0#.f|membership|" & DataCardValue26.Selected.Email,

    Department:"",

    DisplayName:DataCardValue26.Selected.DisplayName,

    Email:DataCardValue26.Selected.Email,

    JobTitle:"",

    Picture:""

    },Office: DataCardValue27.Text})

  • buzzen Profile Picture
    80 on at

    Yeah when I use a SP Text field it works with "DataCardValue26.Selected.DisplayName".

    But with the SP People field and your code "...DataCardValue26.Selected.Email..." it says when saving:

    The specified user i:0#.f|membership| could not be found. 

    Quite strange...

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    Claims:"i:0#.f|membership|"abc@gmail.com

    The above should be format of claims to store in person type field. So set your code according to attach email id with it

     

    Claims:"i:0#.f|membership|" & DataCardValue26.Selected.Email,

     

  • buzzen Profile Picture
    80 on at

    yeah I did it exactly how your wrote it... and the App itself doesn't show an issue with the function... But it still doesn't work... I have the feeling that my whole User Profile setup is wrong.. despite it shows the correct data. Not quite sure if it has something to do with the Data source dependency from the DataCardValue26 field....

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    I usually avoid complex type columns especially person type. Instead i take 3 text columns and store person's name email and phone it from office365user connector. So no delegation issues plus easy to filter and reference

  • buzzen Profile Picture
    80 on at

    Many thanks for your support... In the end I was able to achieve what I wanted!

    THANKS!

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 477

#2
WarrenBelz Profile Picture

WarrenBelz 341 Most Valuable Professional

#3
11manish Profile Picture

11manish 317

Last 30 days Overall leaderboard