Skip to content

Conversation

@vipulj03
Copy link
Contributor

@vipulj03 vipulj03 commented Mar 4, 2025

By submitting this pull request, you agree to the contribution guidelines

If you aren't familiar with how to contribute to open-source repositories using GitHub, or if you find the instructions on this page confusing, sign up for one of our Sharing is Caring events. It's completely free, and we'll guide you through the process.

To submit a pull request with multiple authors, make sure that at least one commit is a co-authored commit by adding a Co-authored-by: trailer to the commit's message. E.g.: Co-authored-by: name <[email protected]>

Put an x in all the items that apply ([x], without spaces), make notes next to any that haven't been addressed.

  • Bug fix?
  • New sample?
  • Related issues: fixes #X, partially #Y, mentioned in #Z
  • Needs API permissions?
  • Has other prerequisites? (E.g. requires a list, document library, etc.)

What's in this Pull Request?

This sample is a Power Automate cloud flow that can be used to automate sharing of a canvas app.

Checklist

This checklist is mostly useful as a reminder of small things that can easily be forgotten – it is meant as a helpful tool rather than hoops to jump through.

Put an x in all the items that apply ([x], no spaces), make notes next to any that haven't been addressed.

  • My pull request affects only ONE sample.
  • I have updated the README file.
  • My README has at least one static high-resolution screenshot (i.e. not a GIF)
  • My README contains complete setup instructions, including pre-requisites and permissions required

@Katerina-Chernevskaya
Copy link
Contributor

Hi @vipulj03 ,

Thank you for your sample! I was try to import the solution, however, I got the error when tried to add value to environment variables:
image

When I skip this step and proceed with import, I got the following message:
image

Solution "AppSharing" imported successfully with warnings: Flow client error returned with status code "BadRequest" and details "{"error":{"code":"InvalidRequestContent","message":"The request content was invalid and could not be deserialized: 'Could not find member 'isLicenseEntitledByRetrieved' on object of type 'SolutionFlowDefinitionRequestProperties'. Path 'activatedEntity.isLicenseEntitledByRetrieved', line 1, position 6043.'."}}".

Could you please check the source code and test solution pack on you side (try to install in a new environment), and resolve the issue I mentioned above?

Thank you!

Regards,
Katerina Ch.

@Katerina-Chernevskaya Katerina-Chernevskaya added the Needs Attention Something needs to be fixed with the PR before merging label Mar 10, 2025
@Katerina-Chernevskaya
Copy link
Contributor

Hi @vipulj03 ,

I've tested on another tenant and was able to import the solution. Seems the issue above occurs in some tenants.

When I tried to run the flow I got the error:
image
The execution of template action 'Switch' failed: The result of the evaluation of 'scope' action expression '@triggerOutputs()?['body/App_x0020_Name/Value']' is not valid. It is of type 'Null' but is expected to be a value of type 'String, Integer'.

It seems that the field reference should be without space (_x0020_). I tested and for me works this:
image

Could you please check this on your side?

Also I've noticed that you hardcoded app's id in the flow. That makes impossible to take the app id from another tenant. Could you please replace the hardcoded values with dynamically extracted app id?
image

Thank you! If any questions - please ping me.

BR,
Kate Ch.

Added the suggested changes
@vipulj03
Copy link
Contributor Author

vipulj03 commented Jun 1, 2025

Made the changes as suggested.

@Katerina-Chernevskaya
Copy link
Contributor

Hi @vipulj03,

Thank you for the update!
I've checked, but the error in the flow still appears:
image

It seems you use AppNameNew field in the flow, but in the ReadMe file stated to create AppName fiels. Please check it and update the code.

Thank you!

Regards,
Katerina Ch.

vipulj03 and others added 2 commits July 20, 2025 00:03
Changed the README file. The column to be used is AppNameNew
@vipulj03
Copy link
Contributor Author

Updated README file. The flow to be tested with the new column "AppNameNew".

@Katerina-Chernevskaya
Copy link
Contributor

Hi @vipulj03 ,

Thank you for updating the sample! The previous error resolved. However, I got a new one:
image

Could you please resolve it and update the source code?

Thank you!

@vipulj03
Copy link
Contributor Author

Hello @Katerina-Chernevskaya - In my case, the power automate flow is executing correctly (please find below image). Hopefully, the "Users" column in the SharePoint list is marked as multiple selection=Yes (as mentioned in Readme file).
However, I have updated the solution and submitted the pull request again. Kindly have a look, thanks!

App Sharing Flow

@Katerina-Chernevskaya
Copy link
Contributor

Hi @vipulj03 ,

Thank you for the update! However, another error appeared - related to the app name:
image

I use my app name and as mentioned earlier it's important to not hard cored its value. You fixed it - thank you! But didn't add the step for setting value for variable into Default branch:
image

Basically, I don't think you need this branches at all - you can just set the variable value dynamically from the info that came from SharePoint.

Could you please update the solution and I'll review it.

Thank you!

BR,
Katerina ch.

Removed the switch case from the flow.
@vipulj03
Copy link
Contributor Author

vipulj03 commented Sep 20, 2025

Hello @Katerina-Chernevskaya

Switch case (branches) is removed. The variable value dynamically added from the info that came from SharePoint.

I have updated the solution and submitted the pull request again. Kindly have a look, thanks!

Copy link
Contributor

@Katerina-Chernevskaya Katerina-Chernevskaya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @vipulj03 ,

Thank you for the update! I made a minor change in the flow code - nested the Apply to each value into array, because this action expected array and failed until I nested the code into the array function.
I also updated the Readme file to aligned with the template.
I'm going to merge the sample. Thank you for your contribution and time!

Kate Ch.

@Katerina-Chernevskaya Katerina-Chernevskaya merged commit 747d68c into pnp:main Sep 23, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Attention Something needs to be fixed with the PR before merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants