SOLVED

Redirecting to SPFX from dynamics crm 365

Copper Contributor

Hi,

 

If i deploy a react app developed in spfx framework. Can i redirect to the react app in sharepoint from Dynamics & pass values from there

4 Replies
best response confirmed by Vishnurameya (Copper Contributor)
Solution

@Vishnurameya Try this:

  1. Create a SPFx web part which can read query string parameters from URL (say myParam)
  2. Add web part on SharePoint site page (say with URL: https://contoso.sharepoint.com/sites/SPConnect/sitepages/mypage.aspx)
  3. Then use URL like below from dynamics to redirect to SP page: 
  4. https://contoso.sharepoint.com/sites/SPConnect/sitepages/mypage.aspx?myParam=My Value
  5. Read myParam value using SPFx web part and use it as per your requirements

Refer these links for more information:

  1. Access the query string from SPFx web part using React 
  2. How can I get query string values in JavaScript? 

Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs

Hi Ganesh
Have a question is there anyway to pass the values to the SPFx form other than Query string

@Vishnurameya If you want to pass the values from other web sites or from dynamics 365, you will have to use query string parameters - this is a easy solution.

 

If you want to pass static values from same SharePoint page where SPFx web part is added, you can use SPFx property pane, check: Make your SharePoint client-side web part configurable 


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs

@ganeshsanap Thank you for your quick reply. It will be a security to pass query string parameters right

1 best response

Accepted Solutions
best response confirmed by Vishnurameya (Copper Contributor)
Solution

@Vishnurameya Try this:

  1. Create a SPFx web part which can read query string parameters from URL (say myParam)
  2. Add web part on SharePoint site page (say with URL: https://contoso.sharepoint.com/sites/SPConnect/sitepages/mypage.aspx)
  3. Then use URL like below from dynamics to redirect to SP page: 
  4. https://contoso.sharepoint.com/sites/SPConnect/sitepages/mypage.aspx?myParam=My Value
  5. Read myParam value using SPFx web part and use it as per your requirements

Refer these links for more information:

  1. Access the query string from SPFx web part using React 
  2. How can I get query string values in JavaScript? 

Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs

View solution in original post