Expand my Community achievements bar.

Join us LIVE in San Francisco on November 14th for Experience Makers The Skill Exchange. Don't miss out on this free learning event!

Best practices for adding external Rich Text to Workfront Rich Text fields

Avatar

Level 1

Does anyone have a best practice solution for bringing text into a Workfront Rich Text field. We are finding when moving text from Rich Text fields in other applications that we are running into characters that are not accepted such as trademark and bullet symbols and we are losing things like URL links and highlighting. Salesforce is one of the source applications where this has been a recurring problem. Is there a parser that can take Rich Text in various formats and bring it easily into the JSON required by the Workfront Rich Text field?

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

12 Replies

Avatar

Level 10

Hi Bret, what modules are you using to move the text over to Workfront? I don't think there should be an issue if its Create or Update Record, but if it was a custom API call you might run into issues unless you first use the "Create JSON" module to place the text into and then send that JSON as the body of your API query.

Avatar

Level 1

I have a very simple scenario...

  1. Read a Salesforce opportunity and capture a Rich Text field
  2. Update a Rich Text field in Workfront with the SF value

Using Update Record like you would for a normal field does not work because it is expecting a JSON payload.

I tried using a Custom API call and that at least got basic text from SF into the WF field, but it is erroring out on a variety of characters such as trademark and bullets.

I didn't think there should be an issue either, but apparently you cannot treat WF Rich Text fields like other fields.

Avatar

Level 4

Hello, could you share the custom API call you used for this?

Avatar

Level 10

Ah you are updating a "text field with formatting" in WF, I missed that part, we haven't started using those fields but i'm guessing its similar issues to the typeahead field issue I ran into last year in Fusion, they cannot be updated in the same way as a simple text field.

If its working when there is no special characters but failing when there is, they probably just need to be escaped. Are you using the "Create JSON" module before sending it via the custom API card, have you an example of a query body you sent to WF that failed?

Avatar

Level 4

Hi @BretKr - I saw this post and I'm trying to do the exact same thing. Push text from a Salesforce field into a Workfront Rich text field via Fusion. Were you able to get this to work and would you be willing to share how you did it? Please let me know. I appreciate any help you can provide.

 

Thanks! 

Michelle

Avatar

Level 2

I have been running into a similar issue I think. When I try update a rich text field using the update record module, even just typing into the field, it send an error message "[403] The following parameter value is invalid '<field name>' please adjust and try again.

Avatar

Level 2

The most important part for that update is to have the correct JSON


This is the format:

{
  "blocks": [
    {
      "key": "",
      "text": "Some Text",
      "type": "unstyled",
      "depth": 0,
      "inlineStyleRanges": [],
      "entityRanges": [],
      "data": {}
    }
  ],
  "entityMap": {}
}

undu82_0-1696367662942.png

Just add the desire text under text and you are good to go.

Avatar

Level 2

Would it be possible to have it map the text as a hyperlink instead of having the whole URL shown?

Avatar

Level 2

Yes you can, but is a little more tricky

 

 

{
    "blocks": [
        {
            "key": "",
            "text": "hello",
            "type": "unstyled",
            "depth": 0,
            "inlineStyleRanges": [],
            "entityRanges": [
                {
                    "offset": 0,
                    "length": 5,
                    "key": 0
                }
            ],
            "data": {}
        }
    ],
    "entityMap": {
        "0": {
            "type": "LINK",
            "mutability": "MUTABLE",
            "data": {
                "url": "https://somelink.com"
            }
        }
    }
}

 

In the entityRanges you have to define the key, and use that key in entityMap

The lenght is just the lenght of the text "hello"

 

Hope it helps

Avatar

Level 2

This is exactly what I was trying to do, thank you so much!

Avatar

Employee

Hello ,
I am running into trouble when my hyperlinks have a space which I replace by %20..
I need to escape the % character 
This throws invalid parameter error from the attask api,this is a custom rich text field.