cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
schwibach
Helper V
Helper V

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
Super User

@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
Super User

@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.

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
Super User

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
Helper V
Helper V

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
Super User

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
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,551)