Forum Discussion
Update custom partition
- 1 year ago
Hi Peter_23,
Thank you for your follow up query. I apologize for any inconvenience you may have experienced.
As per the details provided previously, I have gone through the code again and made some small changed based on the requirement, so I request you to please try the below provided code if the issue persist, please feel free to reach out to us.
Code1:$updatedPartitionDefinition = @{
"createOrReplace" = @{
"object" = @{
"database" = "base"
"table" = "mytable"
"partition" = "BB"
}
"partition" = @{
"name" = "BB"
"source" = @{
"type" = "m"
"expression" = @(
"let",
"source = ...",
"#\Filtered Rows\"= Table.SelectRows(source, each [#\"Query-filter\"] = \"BB\")",
"in",
"FilteredRows"
)
}
}
}
}
Code2:
$refreshRequest = @{
"refresh" = @{
"type" = "dataOnly"
"objects" = @(
@{
"database" = "base"
"table" = "mytable"
"partition" = "BB"
}
)
}
}
If you have any further queries please feel free to reach out to us we will guide you accordingly. If this post helps, then please give us 'Kudos' and consider Accept it as a solution to help the other members find it more quickly.
Thank you.
Hi Peter_23,
Thank you for reaching out to the Microsoft Fabric community Forum.
As per the details provided, I have gone through the code and made some small changed some based on the requirement, so I request you to please try the below provided code if the issue persist, please feel free to reach out to us.
Code1:
$updatedPartitionDefinition = @{
"createOrReplace" = @{
"object" = @{
"database" = "base"
"table" = "mytable"
"partition" = "AA"
}
"partition" = @{
"name" = "AA"
"source" = @{
"type" = "m"
"expression" = @(
"let",
"source...",
"#\Filtered Rows\"= Table.SelectRows(source, each [#\"Query-filter\"] = \"NEW_KEYPARAMETER_VALUE\")",
"in..."
)
}
}
}
}
Code2:
$refreshRequest = @{
"refresh" = @{
"type" = "dataOnly"
"objects" = @(
@{
"database" = "base"
"table" = "mytable"
"partition" = "AA"
}
)
}
}
I hope my suggestions give you good ideas, if you have any more questions, please feel free to reach out.
If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly
Thank you.
I created a new partition with your scripts:
$updatedPartitionDefinition = @{
"createOrReplace" = @{
"object" = @{
"database" = "base"
"table" = "mytable"
"partition" = "BB"
}
"partition" = @{
"name" = "BB"
"source" = @{
"type" = "m"
"expression" = @(
"let",
"source...",
"#\Filtered Rows\"= Table.SelectRows(source, each [#\"Query-filter\"] = \"BB\")",
"in..."
)
}
}
}
}
I update the partitions with:
$refreshRequest = @{
"refresh" = @{
"type" = "dataOnly"
"objects" = @(
@{
"database" = "base"
"table" = "mytable"
"partition" = "BB"
}
)
}
}
I run the script, it update with 0 rows 😞 but the dataset it contains values with "BB" (value requiered for partition)
I don't know whats happening ..
I find xmla parameter is possible update the parameter with it?
thanks in advance.
- v-kpoloju-msft1 year agoCommunity Support
Hi Peter_23,
Thank you for your follow up query. I apologize for any inconvenience you may have experienced.
As per the details provided previously, I have gone through the code again and made some small changed based on the requirement, so I request you to please try the below provided code if the issue persist, please feel free to reach out to us.
Code1:$updatedPartitionDefinition = @{
"createOrReplace" = @{
"object" = @{
"database" = "base"
"table" = "mytable"
"partition" = "BB"
}
"partition" = @{
"name" = "BB"
"source" = @{
"type" = "m"
"expression" = @(
"let",
"source = ...",
"#\Filtered Rows\"= Table.SelectRows(source, each [#\"Query-filter\"] = \"BB\")",
"in",
"FilteredRows"
)
}
}
}
}
Code2:
$refreshRequest = @{
"refresh" = @{
"type" = "dataOnly"
"objects" = @(
@{
"database" = "base"
"table" = "mytable"
"partition" = "BB"
}
)
}
}
If you have any further queries please feel free to reach out to us we will guide you accordingly. If this post helps, then please give us 'Kudos' and consider Accept it as a solution to help the other members find it more quickly.
Thank you.- Peter_231 year agoAdvocate V