Thursday, 17 July 2025

PnP Search web part and available Tokens (Query Variables)

V4 Tokens: https://microsoft-search.github.io/pnp-modern-search/usage/search-results/tokens/ 

I wanted to use the PnP Search web part to get all the birthdays stored in AD (also known as the User Profile Service).

It's easy enough to get the birthday by mapping the SPS-Birthday from the LocalPeopleResults results source, however the issue is that Birthdays don't save year, so when you get the birthday out it will look like 11 July 2000, which when querying become an issue. Unless you use theses Tokens.

For this example and explanation we have Mapped RefinableDate01 with People: SPS-Birthday

  • I started by trying to get the Month Birthdays, like this:
    • RefinableDate01>=2000-07-01 AND RefinableDate01<=2000-07-31
    • But this is not Dynamic, they will only give July's Birthdays.
  • I then tried the Today Token
    • RefinableDate00>={Today} AND RefinableDate00<={Today}+30
    • However because the birthday year is 2000, it will never match

Query variableExample / Result
{Today+/- <integer value for number of days>}

{Today} - 2014-04-26

{Today+10} - 2014-05-06 

{Today-365} - 2013-04-26


  • Now we know about better Tokens we can use
    • RefinableDate00>=2000-{CurrentMonth}-01 AND RefinableDate00<=2000-{CurrentMonth}-31
    • This gives us our desire result
Token Definition
{CurrentYear} Local date four digits, 2023
{CurrentMonth} Local month, 1-12
{CurrentDate} Local date, 1-31
{CurrentHour} Local hour, 0-23
{CurrentMinute} Local minute, 0-59
{CurrentSecond} Local second, 0-59
{CurrentYearUTC} UTC date four digits, 2023
{CurrentMonthUTC} UTC month, 1-12
{CurrentDateUTC} UTC date, 1-31
{CurrentHourUTC} UTC, 0-23
{CurrentMinuteUTC} UTC minute, 0-59
{CurrentSecondUTC} UTC second, 0-59


Friday, 4 July 2025

AI Prompting: Example for Workflow Technical Spec's

 We are all using some sort of AI at this point, but here are some ways to get better results.


“Who should the AI be?”


Role

This sets the persona or expertise you're expecting. It frames the AI’s tone, depth, and assumptions.

“What does the AI need to know?”


Context

Give the background info that influences the task. This ensures the AI understands the situation.
 

“What do you want it to do?” 

 

Command

Be direct and specific about the task.

“How should the output look?” 


 


Format

Tell the AI what kind of structure or layout you want.


 Example

 

I want a Technical Specification of this workflow for the client after the build is complete.

Role:

  • This information is for the Technical users and Process Owners.

Context:

  • I need a summary that clearly explains what the workflow does, how it runs, and which integrations and accounts it uses.

Command:

  • Provide the following sections:
  • Summary: A high-level overview of what the workflow does.
  • Workflow Actions: 
    • Starting with the Tigger. 
    • Process list of all the workflow actions.
  • Integrations: Show any integration, if any. 
  • Accounts: All accounts and email addresses.

Format:

  • Use clear section headings as follows:
    • Summary
    • Workflow Actions
    • Integrations
    • Accounts
  • Use:
    • Numbered lists for workflow steps.
    • Bullet points for integrations and accounts.
    • Use plain language and describe the purpose of each step.