Getting value of a label in a Web Page into a script variable

Hello,

for one of my use case I need to embed a web page into my script and I would need to retrieve info from that webpage to be able to use it as a variable into the script itself without having to copy past this info.

Do you now if it is possible to play with label/tag from the web page into the script?

Thanks in advance for your answer.

Kind regards,

NT

The iframe embedding your script will be loaded from a different domain than the PureCloud app and will therefore not have access to the parent page, and vice versa. You can update participant attributes on the conversation from the script so your embedded page can be authorized by the user and use the API to read them.

Hello Tim ,

thanks for your answer.
Not sure I correctly understood your statement :

How should I do this?

Kind regards,

NT.

The flow would be something like this:

  1. External web app is loaded in the script
  2. External web app executes implicit grant for the agent to authorize the app
  3. External web app uses APIs to retrieve the user's current conversation information, then sets participant attributes as necessary.
  4. Agent clicks a button in the page to retrieve data from participant attributes using a purecloud data action and display in the script. This step requires manual intervention because the script does not monitor for changes to the participant attributes after the initial script is loaded.

There are a whole lot of other ways you could implement data transactions with your external system, but the above is one possibility based on the information I have (only that you're using a script and an external web page).

Hello Tim,

thanks a lot for your answer.
If I correctly understood, this means that I need to "own" the external web app which is unfortunately not the case...

So I guess that what I want to do is not possible...

Kind regards,

Nathan.

Correct. If you can't alter the app yourself, there is nothing PureCloud can do to bypass browser-enforced iframe security restrictions.

Thanks Tim, this is what I thought but wanted to check :stuck_out_tongue: , this is clear now :slight_smile:

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.