cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
MartinHagara
Level: Powered On

Save data to SharePoint

Hi,

Patch reports me an error: the type of this argument "xxx" does not match the expected Record type. Number type found.
I have created a list on SharePoint with Record columns and here I need to write ID of selected items from combobox in Powerapps. Is there any way to solve it?

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support Team
Community Support Team

Re: Save data to SharePoint

Hi @MartinHagara ,

Could you please share more details about the formula you provided within the Items proerpty of the DruhComboBox (ComboBox3_9), KategoriaComboBox (ComboBox3_10), ... ? Do you type Distinct(...) formula within the Items property of these ComboBox?

 

Please consider modify your formula as below:

Patch(
           Pozorovania;
           Defaults(Pozorovania);
          {
              Druh: {
Id: LookUp(colDruhy; Title = ComboBox3_9.Selected.DisplayColumn; ID); /* <-- Do not miss ; operator here */ Value: ComboBox3_9.Selected.DisplayColumn }; 'Kategoria': {
Id: LookUp(colKategorie; Title = ComboBox3_10.Selected.DisplayColumn1; ID); /* <-- Do not miss ; operator here */ Value: ComboBox3_10.Selected.DisplayColumn1 }; ...
Lokalita: {
Id: LookUp(colLokality; Title = ComboBox3_11.Selected.DisplayColumn3; ID); /* <-- Do not miss ; operator here */
Value: ComboBox3_11.Selected.DisplayColumn3
};
... } ) 

Note: The DisplayColumn, DisplayColumn2, DisplayColumn3, .. represents the columns you used as display value within the ComboBox3_9, ComboBox3_10, ComboBox3_11, ....

 

If you set the Items property of the ComboBox3_9, ComboBox3_10, ComboBox3_11, ... to a Distinct function, please modify above formula as below:

Patch(
           Pozorovania;
           Defaults(Pozorovania);
          {
              Druh: {
Id: LookUp(colDruhy; Title = ComboBox3_9.Selected.Result; ID); /* <-- Do not miss ; operator here */ Value: ComboBox3_9.Selected.Result }; 'Kategoria': {
Id: LookUp(colKategorie; Title = ComboBox3_10.Selected.Result; ID); /* <-- Do not miss ; operator here */ Value: ComboBox3_10.Selected.Result }; ...
Lokalita: {
Id: LookUp(colLokality; Title = ComboBox3_11.Selected.Result; ID); /* <-- Do not miss ; operator here */
Value: ComboBox3_11.Selected.Result
};
... } ) 

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Community Support Team
Community Support Team

Re: Save data to SharePoint

Hi @MartinHagara ,

Have you solved your problem?

 

If you have solved your problem, please consider go ahead to click "Accept as Solution" to identify this thread has been solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

13 REPLIES 13
Community Support Team
Community Support Team

Re: Save data to SharePoint

Hi @MartinHagara ,

Could you please share more details about the error message within your app?

Could you please show more details about the Druh field, Kategoria field, Lokalita, Vek field Pohlavie field, ... within your SP List? Are they Choice type fields or Number type fields?

 

Based on the error message that you mentioned, I think there is something wrong with the value you provided for the arguments within your Patch function. The specific argument is required to provide a record value, but you provide a Number value.

 

If the Druh field, Kategoria field, Lokalita, Vek field Pohlavie field, ... are all Choice type fields in your SP List, I think there is something with your Patch formula.

When specifying values for Choice type field within Patch function, you should provide a Record value rather than a Text or Number value. Please consider modify your formula as below:

Patch(
           Pozorovania;
           Defaults(Pozorovania);
          {
              Druh: {
                           Value: ComboBox3_9.Selected.ID
                        };
             'Kategoria': {
                                   Value: ComboBox3_10.Selected.ID
                                };
              ...
Lokalita: {
Value: ComboBox3_11.Selected.ID
};
... } )

or

Patch(
           Pozorovania;
           Defaults(Pozorovania);
          {
              Druh: ComboBox3_9.Selected;
             'Kategoria':ComboBox3_10.Selected;
              ...
Lokalita: ComboBox3_11.Selected;
... } )

Please take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
MartinHagara
Level: Powered On

Re: Save data to SharePoint

Hi,

Thank you, none of the above options work for me. It gives me an error message: Awaiting Record but a different schema. Missing ID column with Number.
Do you still have an idea?
Attaching SharePoint List column types:

Druh = Record

Počet = Number

Kategória = Record

Dátum a čas = Date and Time

Lokalita = Record

Vek = Record

Pohlavie = Record

Pozorovateľ 1 = Record

Pozorovateľ 2 = Record

Projekt = Record

Poznámka = Long Text

Community Support Team
Community Support Team

Re: Save data to SharePoint

Hi @MartinHagara ,

Are the Druh, Kategória, Lokalita, Vek, Pohlavie, Pozorovateľ 1, Pozorovateľ 2 and Projekt field all LookUp type column in your SP List?

 

If the Druh, Kategória, Lokalita, Vek, Pohlavie, Pozorovateľ 1, Pozorovateľ 2 and Projekt field are all LookUp type column in your SP List, please consider modify your formula as below:

Patch(
           Pozorovania;
           Defaults(Pozorovania);
          {
              Druh: {
Id: LookUp(ReferencedSPList, ReferencedColumn = ComboBox3_9.Selected.Value, ID) Value: ComboBox3_9.Selected.Value }; 'Kategoria': {
Id: LookUp(ReferencedSPList, ReferencedColumn = ComboBox3_10.Selected.Value, ID) Value: ComboBox3_10.Selected.Value }; ...
Lokalita: {
Id: LookUp(ReferencedSPList, ReferencedColumn = ComboBox3_11.Selected.Value, ID)
Value: ComboBox3_11.Selected.Value
};
... } )

Note: I assume that The Druh field referenve values from the ReferencedColumn in ReferencedSPList, same for Kategória, Lokalita, Vek, Pohlavie, Pozorovateľ 1, Pozorovateľ 2 and Projekt field.

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
MartinHagara
Level: Powered On

Re: Save data to SharePoint

Yes, the Druh, Kategória, Lokalita, Vek, Pohlavie, Pozorovateľ 1, Pozorovateľ 2 and Projekt are field all LookUp type column in my SP List...

It's better, but I still have a problem: LookUp has invalid arguments.
And I don't understand your Note - how do I find out? :

Note: I assume that The Druh field referenve values from the ReferencedColumn in ReferencedSPList, same for Kategória, Lokalita, Vek, Pohlavie, Pozorovateľ 1, Pozorovateľ 2 and Projekt field.

MartinHagara
Level: Powered On

Re: Save data to SharePoint

Could my listing look like this?
Or is it even correct?

Community Support Team
Community Support Team

Re: Save data to SharePoint

Hi @MartinHagara ,

Please consider modify your formula as below:

Patch(
           Pozorovania;
           Defaults(Pozorovania);
          {
              Druh: {
Id: LookUp(colDruhy; Title = ComboBox3_9.Selected.Value; ID); /* <-- Do not miss ; operator here */ Value: ComboBox3_9.Selected.Value }; 'Kategoria': {
Id: LookUp(colKategorie; Title = ComboBox3_10.Selected.Value; ID); /* <-- Do not miss ; operator here */ Value: ComboBox3_10.Selected.Value }; ...
Lokalita: {
Id: LookUp(colLokality; Title = ComboBox3_11.Selected.Value; ID); /* <-- Do not miss ; operator here */
Value: ComboBox3_11.Selected.Value
};
... } ) 

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
MartinHagara
Level: Powered On

Re: Save data to SharePoint

yes, I thought of it, I added a perator, but without changes ...

 

Community Support Team
Community Support Team

Re: Save data to SharePoint

Hi @MartinHagara ,

Could you please share more details about the formula you provided within the Items proerpty of the DruhComboBox (ComboBox3_9), KategoriaComboBox (ComboBox3_10), ... ? Do you type Distinct(...) formula within the Items property of these ComboBox?

 

Please consider modify your formula as below:

Patch(
           Pozorovania;
           Defaults(Pozorovania);
          {
              Druh: {
Id: LookUp(colDruhy; Title = ComboBox3_9.Selected.DisplayColumn; ID); /* <-- Do not miss ; operator here */ Value: ComboBox3_9.Selected.DisplayColumn }; 'Kategoria': {
Id: LookUp(colKategorie; Title = ComboBox3_10.Selected.DisplayColumn1; ID); /* <-- Do not miss ; operator here */ Value: ComboBox3_10.Selected.DisplayColumn1 }; ...
Lokalita: {
Id: LookUp(colLokality; Title = ComboBox3_11.Selected.DisplayColumn3; ID); /* <-- Do not miss ; operator here */
Value: ComboBox3_11.Selected.DisplayColumn3
};
... } ) 

Note: The DisplayColumn, DisplayColumn2, DisplayColumn3, .. represents the columns you used as display value within the ComboBox3_9, ComboBox3_10, ComboBox3_11, ....

 

If you set the Items property of the ComboBox3_9, ComboBox3_10, ComboBox3_11, ... to a Distinct function, please modify above formula as below:

Patch(
           Pozorovania;
           Defaults(Pozorovania);
          {
              Druh: {
Id: LookUp(colDruhy; Title = ComboBox3_9.Selected.Result; ID); /* <-- Do not miss ; operator here */ Value: ComboBox3_9.Selected.Result }; 'Kategoria': {
Id: LookUp(colKategorie; Title = ComboBox3_10.Selected.Result; ID); /* <-- Do not miss ; operator here */ Value: ComboBox3_10.Selected.Result }; ...
Lokalita: {
Id: LookUp(colLokality; Title = ComboBox3_11.Selected.Result; ID); /* <-- Do not miss ; operator here */
Value: ComboBox3_11.Selected.Result
};
... } ) 

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

MartinHagara
Level: Powered On

Re: Save data to SharePoint

I am sending items property...

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 243 members 5,375 guests
Please welcome our newest community members: