Thank you for another interesting solution, just not for the problem I have.
I'm using a canvas app. The app has two dropdowns.
I'm using two collections.
ClearCollect(allTeams, MicrosoftTeams.GetAllTeams().value);
ClearCollect(allBuckets, Planner.ListBucketsV3("valid reference to a team","valid reference to a plan").value);
dd_Team shows the allTeams collection.
allTeams
dd_Plan shows the plans for the selected team in dd_Team
Planner.ListGroupPlans(dd_Team.Selected.id).value
The app has two date pickers
DateStart is Today()-7.
DateEnd is Today.
Next the application has a DataTable which is populated by this code:
Filter(Planner.ListTasksV3(dd_Plan.Selected.id,dd_Team.Selected.id).value,completedDateTime>=DateStart,completedDateTime<=DateEnd)
Using the PowerApps user interface, I selected the createdBy column, and PowerApps wrote this as a command to populate that field:
ThisItem.createdBy.user.id
My goal is to take that value and find the displayName instead of the id.
This fails:
Office365Users.UserProfileV2(ThisItem.createdBy.user.id).displayName
I ran my application and found a valid user.id string and just pasted into a label to see if it would work. It works:
Office365Users.UserProfileV2("ccf81f63-7185-41bd-991e-807887b3986e").displayName
So, there's something about "ThisItem" that is failing to convert the id to a valid string for Office365Users to consume. ThisItem is data type "record". The PowerApps UI states that "The method UserProfileV2 has an invalid value for parameter 'id'". Since that function expect text, I thought of converting the value to text using this function:
Office365Users.UserProfileV2(Text(ThisItem.createdBy.user.id)).displayName
this also fails, but in this case with
{"statusCode" : 404, "message": "Resource not found"}
I'd prefer not to refactor the entire application. The core issue is converting a record data type's ThisItem.createdBy.user.id into a format consumeable by the UserProfileV2 method.