Is it possible to do read and write operations in a Repository by using pega?

How can u read from a repository and write it back to it. This was asked in an interview

Hi @TanyaS58,

You need create a repository and give required permissions in repository side.

Please go though below article, you will get a idea.

How to leverage PEGA Repository API — Amazon S3 for file storage.

I hope this will help you.

Thanks,

Ashok

@TanyaS58

You can leverage OOTB Pega repository APIs

D_pxDelete: Delete a file from repositoryName in the specified filePath

Eg: D_pxDelete[repositoryName:Param.repositoryName,filePath:Param.filePath,recursiveDelete:Param.recursiveDelete]

D_pxGetFile: Represents a file stored in a repository. Takes a repository name, a file path, and an optional response type, which must be either “STRING” or “STREAM”, and which defaults to the former.

Eg: D_pxGetFile[repositoryName:Param.repositoryName,filePath:Param.filePath,responseType:Param.responseType]

D_pxGetFile[repositoryName:“pegacloudrepository”,filePath:.pyPath,responseType:“String”].pyContents

D_pxListFiles: Load the page with repository name and the path of the folder whose contents need to be listed