SharePoint Online JSON Column Formatting

hello all,

I am using the below column formatting JASON code in order to create a link to a site:

{
“$schema”: “”,
“elmType”: “a”,
“txtContent”: “@currentField”,
“attributes”: {
“target”: “_blank”,
“href”: “='https://www.awebsite.com?ID=’+[$ID]
}
}

I have Microsoft flow based on conditions to set text at the column, so I would like the link to change based on the text:

  • when the text at the column is “create” then to have the link: to the above link

  • when the text at the column is “view” then to have the link: “href”: “='https://www.anotherwebsite.com?ID=’+[$ID]

so basically an IF statement would probably do it I just need some assistance.
thank you