cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
schwibach
Resolver I
Resolver I

Taking data from a SharePoint list item and entering it into a form on submitting

I am building an app that will create new items for a SharePoint list.

 

I have three fields in my form where users have to enter data that will go into said SharePoint list.

That part works nicely.

 

I have another column in that Sharepoint list that I want to fill for each item that is created.
But I want to take the data to fill into that column from another Sharepoint list where information is stored on each user, so they don't have to fill it in every time.

 

I think I should be adding a line above "SubmitForm(Form_NeueZahlen)"

The name of the form is "Form_Neue Zahlen"

The field name in the SharePoint list is "Schule"

and I want to enter the result of this "LookUp(Schulzugehörigkeit; Lower(Title) = Lower(User().Email); Organisation)"

 

I don't know the syntax for this. I'd appreciate any help.

1 ACCEPTED SOLUTION

Accepted Solutions
eka24
Super User III
Super User III

@schwibach 

Is your form Form_Neue Zahlen connected to the Table Schule?

 

If so:

In that field on your form you can either put the whole formula into the Default of the DataCardValue / Field on your form:

   LookUp(Schulzugehörigkeit; Lower(Title) = Lower(User().Email); Organisation)

 

OR
A better option is to create a Variable OnStart of the App:

  Set(varOrganisation,LookUp(Schulzugehörigkeit; Lower(Title) = Lower(User().Email); Organisation))

Then in the Default of the DataCardValue / Field on your form put:

  varOrganisation

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

5 REPLIES 5
eka24
Super User III
Super User III

@schwibach 

Is your form Form_Neue Zahlen connected to the Table Schule?

 

If so:

In that field on your form you can either put the whole formula into the Default of the DataCardValue / Field on your form:

   LookUp(Schulzugehörigkeit; Lower(Title) = Lower(User().Email); Organisation)

 

OR
A better option is to create a Variable OnStart of the App:

  Set(varOrganisation,LookUp(Schulzugehörigkeit; Lower(Title) = Lower(User().Email); Organisation))

Then in the Default of the DataCardValue / Field on your form put:

  varOrganisation

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

Thanks for the reply.

The problem is:
That field does not exist in my form and I don't want it shown in the app.
I could, however, follow your solution, create this field and set it to invisible.

 

Is this how you'd do it or is there a more 'proper' way of doing this? 

eka24
Super User III
Super User III

If the field does not exist on your form, then you can use the Patch Function:

 

Create a Variable OnStart of the App:

  Set(varOrganisation,LookUp(Schulzugehörigkeit; Lower(Title) = Lower(User().Email); Organisation))

 

Then insert a button and OnSelect of that button put:

Patch( SharepointListName, Defaults( SharepointListName), { Schule: varOrganisation } )

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

 

schwibach
Resolver I
Resolver I

Thank you so much! It worked like a charm.

 

I'll have to look into the Patch function more.

I don't understand, how your last solution wouldn't give me a new item with just the info from the variable instead of the 3 fields from the form and the 1 field from the other SharePoint list.

eka24
Super User III
Super User III

I believe the form is in Edit Mode that is why it did not produce new row or new item.

If you want it new item / record, the form your be in New Mode.

For the Patch:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-patch

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (936)