cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Samo2005
Frequent Visitor

Referencing SharePoint field within PowerApps

Hi everyone I am new to PowerApps and I have a question.

 

Sorry for the long post.

 

We have a SharePoint list used for checking stock-taking, every month the purchasing list items they want branches to do a stocktake. so we have columns like the name of the item, internal code, manufacturers code etc.. and Leeds, Sheffield, Derby etc..

 

So every month branch manager would get the list and he/she carries out a stocktake and comes to the list to find his branch i.e. Sheffield (a choice type) and enter yes or No.

 

What I want to do is filter the rows for a specific branch. So the manager only sees his/her own stock lines that they need to update and then changes the value to Yes or No.

 

   I can get the manager's branch from Office 365 and I am wondering if

 

Branch = Sheffield then find the column called Sheffield and filter the rows for Sheffield and return the value Yes or No.

 

Can this be done?

 

Cheers

Wessam                      

6 REPLIES 6
BrianS
Super User
Super User

Not sure exactly how your data is structured but this should get you the info you need:

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

 

Hi @Samo2005 

One way to accomplish your goal is to create a global variable for the User's branch when the app is opened and then use that variable to filter the data source for your galleries.  Something like

Set(brnch, Lookup(Outlook365, Email=User().Email, Branch) 

in the OnStart property of the app and 

Filter(datasource,Branch=brnch)

 in the Items property of a gallery.

Hi BrianS 

 

Thank you for your reply, I attached a screen showing of the list column structure and I need to retrieve the name of the column rather than True or False.

 

Cheers for looking.

 

Wessam 

 

I do not know any way to retrieve a column name and then use that in a function. You would have to set up the logic to check for a specific column depending on the value of a variable. You could gathered the Branch of the current user in a variable and then used a Switch function to select the field and then test that for a value.

Samo2005
Frequent Visitor

Thanks, I did use Office365 and returned the branch from the field Location but I tried to get to the column name but it didn't work.

 

Back to drawing board and I will have to design the list provided business is open to it.

 

Cheers

Wessam

If you know the branch then you can assign that to a variable and use a Switch function to look in various columns. 

the Switch Function is like If but designed for multiple answers so you do not have to nest the Ifs.

Here is the documentation:

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

You can use that to Filter your list 

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 (1,342)